package com.zeta.eduservice.controller.question;


import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.zeta.commonutils.R;
import com.zeta.eduservice.entity.question.EduQuestionTypeUserAndFolder;
import com.zeta.eduservice.service.EduQuestionTypeSysService;
import com.zeta.eduservice.service.EduQuestionTypeUserAndFolderService;

/**
 * <p>
 * 课程 班级中间表 前端控制器
 * </p>
 *
 * @author zeta
 * @since 2021-03-29
 */
@CrossOrigin
@RestController
@RequestMapping("/eduservice/edu_question_type_user_and_folder")
public class EduQuestionTypeUserAndFolderController {

	@Autowired
	private EduQuestionTypeUserAndFolderService service;
@PostMapping("")
public R save(@RequestBody EduQuestionTypeUserAndFolder sys) {
	service.save(sys);
	return R.ok();
}
@GetMapping("getListByFolderId/{folderId}")
public R getListByFolderId(@PathVariable String  folderId) {
QueryWrapper<EduQuestionTypeUserAndFolder> queryWrapper=new QueryWrapper<EduQuestionTypeUserAndFolder>();
queryWrapper.eq("folder_id", folderId);
	List<EduQuestionTypeUserAndFolder> list = service.list(queryWrapper);
	return R.ok().data("list",list);
}
}

